<script lang="ts">
import { h, withDefaults, onMounted, defineProps, ref } from 'vue'
import { FormItem, Input, Select } from 'ant-design-vue'
import { string } from 'vue-types'

export default {
  props: {
    itemConfig: {
      type: Object,
      default: {}
    },
    value: {
      type: String
    }
  },

  setup(props, { emit }) {
    const { type, label, formKey } = props.itemConfig
    return () =>
      h(
        FormItem,
        {
          label,
          name: 'contenet'
        },
        () =>
          h(type, {
            value: props.value,
            id: '001',
            onChange: (val) => {
              emit('update:value', val.target.value)
            },

            onPressEnter: (val) => {
              console.log(`onPressEnter`)
            }
          }) // input组件
      )
  }
}
</script>
